﻿@model VoiceAd.Models.tblCampaign
@{
    ViewBag.Title = "Chi tiết chiến dịch";
    Layout = "~/Views/Shared/_LayoutContent.cshtml";
}
<script type="text/javascript">
    $(function () {
        $("#txtDay").datepicker({
            showOn: "button",
            dateFormat: 'yy-mm-dd',
            buttonImage: "/Content/images/calendar.gif",
            buttonImageOnly: true
        });

        $("#dvUpload").fileUpload({
            'uploader': '/Scripts/uploader.swf',
            'cancelImg': '/Images/cancel.png',
            'buttonText': 'Upload file',
             'script': "@Url.Action("UploadAvatar", "customer")",     
            'onComplete': function (event, queueID, fileObj, response, data) {
                $("#txtUrl").val(response);
            },
            'folder': '/uploads',
            'fileDesc': 'Music Files',
            'fileExt': '*.mp3',
            'multi': true,
            'auto': true
        });

    });
</script>
<div class="dvTitleBook">
    Chiến dịch đang chạy
</div>
<div class="dvArrActive">
    <div class="dvColCampName">
        chiến dịch
    </div>
    <div class="dvColBorder">
    </div>
    <div class="dvColNgay">
        ngày bắt đầu
    </div>
    <div class="dvColBorder">
    </div>
    <div class="dvColNgay">
        ngày kết thúc
    </div>
    <div class="dvColBorder">
    </div>
    <div class="dvColNgay">
        số ngày upload file monitor
    </div>
</div>
<div class="dv960">
    <div class="dvWidth215 dvTextTitle">
        @Model.Title
    </div>
    <div class="dvWidth5">
    </div>
    <div class="dvWidth200">
    </div>
    <div class="dvWidth5">
    </div>
    <div class="dvWidth175 dvTextCenter">
        @Model.BeginDay.Value.ToString("dd/MM/yyyy")
    </div>
    <div class="dvWidth5">
    </div>
    <div class="dvWidth175 dvTextCenter">
        @Model.EndDay.Value.ToString("dd/MM/yyyy")
    </div>
    <div class="dvWidth5">
    </div>
    <div class="dvWidth175">
    </div>
    <div class="clear dvHeight20">
    </div>
</div>
<div class="dvBoxStation">
    <div class="dvColDay">
        Ngày
    </div>
    <div class="dvColStationMp3">
        file
    </div>
    <div class="dvColListen">
        nghe file mp3
    </div>
    @using (Html.BeginForm())
    {
        @Html.Hidden("CampId", Model.Id);
        <div class="dvCol320">
            @Html.TextBox("txtDay", DateTime.Now.ToString("yyyy-MM-dd"))
        </div>
        <div class="dvCol320">
            <div id="dvUpload">
                <input id="txtUrl" name="txtUrl" type="hidden" value="" />
            </div>
            <input type="submit" value="Cập nhật" />
        </div>
        <div class="dvCol320" style="text-align: left">
            &nbsp;
        </div>
    }
    <div class="clear" style="margin-bottom: 25px;">
        &nbsp;</div>
    @{
        int intSTT = 0;
        string strId = "IdPlayer";
    }
    @foreach (VoiceAd.Models.tblMonitor tbl in ViewBag.lstMonitor)
    {
        <div class="dvCol320 dvTextLeft" style="font-size: 11px; color: Black;">
            <div class="dvMarLeft">@tbl.UploadDay.Value.ToString("dd/MM/yyyy")</div>
        </div>
        <div class="dvCol320" style="font-size: 11px; color: Black;">
            @tbl.UrlFile
        </div>
        <div class="dvCol320 dvTextCenter">
            @{ strId = "IdPlayer" + intSTT.ToString();
            }
            <div id="@strId">
            </div>
            <script type="text/javascript">
                jwplayer("@strId").setup({
                    modes: [{ type: 'html5' }, { type: 'flash', src: 'jwplayer.flash.swf'}],
                    file: '@Url.Content("~/uploads/" + @tbl.UrlFile)',
                    autostart: 'false',
                    type: 'mp3',
                    width: '270',
                    height: '30'
                });
               
            </script>
        </div>
               intSTT++;
          
        <div class="clear">
        </div>
    }
</div>
